<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .big {
            /* position: relative; */
            /* top: 20px;
            left: 20px; */
            /* margin-left: 20px; */
            height: 100px;
            width: 100px;
            background-color: purple;
        }
        
        .samll {
            position: absolute;
            top: 30px;
            left: 20px;
            margin-left: 50px;
            background-color: pink;
            height: 50px;
            width: 50px;
        }
    </style>
</head>

<body style="margin: 0px;">
    <div class="big">
        <div class="samll"></div>
    </div>

</body>
<script>
    var samll = document.querySelector('.samll');
    console.log(samll.offsetLeft);
</script>

</html>